package spring.learn.tx;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import spring.learn.tx.service.UserService;

import java.io.File;

/**
 * Description
 * Copyright © 启明星辰 版权所有
 *
 * @author chenjiquan
 * @date 2024-09-11
 */
@ComponentScan
@MapperScan("spring.learn.tx.mapper")
@EnableTransactionManagement
public class TxApplication {
	public static void main(String[] args) {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TxApplication.class);

		UserService userService = context.getBean("userService", UserService.class);
		userService.insert();
	}

}
